<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@include file="/includes.jsp"%>

<h1 class="layout">
    <logic:empty name="user" property="id">
        Create
    </logic:empty>
    <logic:notEmpty name="user" property="id">
        Edit
    </logic:notEmpty>
    User
</h1>

<html:errors/>

<html:form action="user.do?method=edit" method="post" focus="name">
    <table class="layout" style="background-image: url(<html:rewrite page='/icons/user-32x32.png'/>);">
        <tr>
            <th class="layout">Name:</th>
            <td class="layout"><html:text name="user" property="name" size="80"/></td>
        </tr>
        <tr>
            <th class="layout">Description:</th>
            <td class="layout"><html:textarea name="user" property="description" cols="60" rows="10"/></td>
        </tr>
        <logic:empty name="user" property="id">
            <tr>
                <th class="layout">Password:</th>
                <td class="layout"><html:password property="password" size="20"/></td>
            </tr>
            <tr>
                <th class="layout">Repeat Password:</th>
                <td class="layout"><html:password property="repeatPassword" size="20"/></td>
            </tr>
        </logic:empty>
        <tr>
            <th class="layout">Person:</th>
            <td class="layout">
                <html:select name="userAF" property="personId">
                    <html:options collection="personPairs" property="id" labelProperty="name"/>
                </html:select>
            </td>
        </tr>
    </table>
    <div class="buttons">
        <html:submit property="btnSubmit" value="OK"/>
        <html:cancel property="btnSubmit" value="Cancel"/>
    </div>
</html:form>
